From 6848a1622c9291a8e8aac750440bad66a744f0ed Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Wed, 21 Feb 2007 00:04:06 +0000 Subject: [PATCH] Fix allocation of the error_description fields. Signed-off-by: Ewan Mellor --- tools/libxen/src/xen_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxen/src/xen_common.c b/tools/libxen/src/xen_common.c index 8c5feeb33f..c6e2181850 100644 --- a/tools/libxen/src/xen_common.c +++ b/tools/libxen/src/xen_common.c @@ -989,10 +989,10 @@ static void parse_failure(xen_session *session, xmlNode *node) char **c = (char **)error_descriptions->contents; int n = error_descriptions->size; - char **strings = malloc(3 * sizeof(char *)); + char **strings = malloc(n * sizeof(char *)); for (int i = 0; i < n; i++) { - strings[i] = xen_strdup_(c[i]); + strings[i] = c[i]; } session->error_description_count = n; -- 2.30.2